package cn.springbook.platform.test.controller;

import cn.springbook.common.core.model.ResponseResult;
import cn.springbook.common.core.model.ResponseResultUtil;
import cn.springbook.platform.test.dto.TestDTO;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 接口测试类
 * </p>
 *
 * @author: caifenglin
 * @date: 2021/7/2 16:52
 */
@RestController
@RequestMapping(value = "/paramTest")
public class ParamTestController {

    @GetMapping(value = "/get")
    public ResponseResult<Void> get() {
        return ResponseResultUtil.success("get请求成功");
    }

    @PostMapping(value = "/post")
    public ResponseResult<Void> post() {
        return ResponseResultUtil.success("post请求成功");
    }

    @PostMapping(value = "/param")
    public ResponseResult<TestDTO> param(@RequestBody TestDTO dto) {
        return ResponseResultUtil.success("参数请求成功", dto);
    }

    @PostMapping(value = "/params")
    public ResponseResult<TestDTO> post(TestDTO dto) {
        return ResponseResultUtil.success("参数请求成功", dto);
    }

}
